import {Message} from 'element-ui';

const debug = true;
var URLOBJ = {};

// ======本地地址======
const DEBUGURLOBJ = {
  LOGINURL: 'http://118.31.113.200:9080/login', //登录
  GETRECORD2URL: "http://118.31.113.200:9080/get_record2",  //获取标签
  COMPUTEURL: "http://118.31.113.200:9080/compute", //对比
  UPDATEGROUPURL: "http://118.31.113.200:9080/update_group",  //更新标签
  ADDGROUPURL: "http://118.31.113.200:9080/add_group",  //增加标签
  DELGROUPURL: "http://118.31.113.200:9080/del_group",  //删除标签组
  GETGROUPURL: "http://118.31.113.200:9080/get_group",  //获取标签组
  CREATEREPORTURL: "http://118.31.113.200:9080/create_report",  //创建业绩报
  GET_LABEL_DATA: "http://118.31.113.200:9080/get_label_data",
  GET_KERNEL_LABEL: "http://118.31.113.200:9080/get_kernel_label",
}
// ======线上地址======
const ONLINEURLOBJ = {
  LOGINURL: '/login', //登录
  GETRECORD2URL: "/get_record2",  //获取标签
  COMPUTEURL: "/compute", //对比
  UPDATEGROUPURL: "/update_group",  //更新标签
  ADDGROUPURL: "/add_group",  //增加标签
  DELGROUPURL: "/del_group",  //删除标签组
  GETGROUPURL: "/get_group",  //获取标签组
  CREATEREPORTURL: "/create_report",  //创建业绩报
  GET_LABEL_DATA: "/get_label_data",
  GET_KERNEL_LABEL: "/get_kernel_label",
}

if (debug) {
  URLOBJ = DEBUGURLOBJ;
} else {
  URLOBJ = ONLINEURLOBJ;
}

//  element-ui的提示警告
const warnMessage = (mess) => {
  Message.closeAll();
  Message.warning({
    message: mess,
    center: true,
    duration: 2000,
  })
};

//  element-ui的提示错误
const errorMessage = (mess) => {
  Message.closeAll();
  Message.error({
    message: mess,
    center: true,
    duration: 2000,
  })
};

//  element-ui的关闭全部提示
const closeMessage = () => {
  Message.closeAll();
};



export {
  warnMessage,
  errorMessage,
  closeMessage,
  URLOBJ
}
